package com.tianji.learning.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tianji.common.domain.dto.PageDTO;
import com.tianji.common.domain.query.PageQuery;
import com.tianji.learning.domain.dto.LearningPlanDTO;
import com.tianji.learning.domain.vo.LearningLessonVO;
import com.tianji.learning.domain.vo.LearningPlanPageVO;
import com.tianji.learning.model.po.LearningLesson;

import java.util.List;

/**
 * 学生课表，服务类
 */
public interface ILearningLessonService extends IService<LearningLesson> {

    /**
     * 添加课程信息到用户课程表
     *
     * @param userId
     * @param courseIds
     */
    void addUserLessons(Long userId, List<Long> courseIds);

    //分页查询我的课表
    PageDTO<LearningLessonVO> pageQuery(PageQuery query);

    //查询正在学习的课程
    LearningLessonVO getNowLearningLesson();

    //删除已失效课程
    void deleteLesson(Long userId, Long courseId);

    //检查课程是否有效
    Long isLessonValid(Long courseId);

    //查询用户课表中指定课程状态
    LearningLessonVO getLessonStatusByCourseId(Long courseId);

    //统计课程学习人数
    Integer countLearningLessonByCourse(Long courseId);

    //查询课表
    LearningLesson queryByUserAndCourseId(Long userId, Long courseId);

    //创建学习计划
    void addPlans(LearningPlanDTO dto);

    //查询学习计划进度
    LearningPlanPageVO getPlans(PageQuery pageQuery);
}